# as --32 -gstabs -o cmovtest.o cmovtest.s
# ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -lc -o cmovtest cmovtest.o


.section .data
output:
    .asciz "The largest number is: %d\n"

values:
    .int 10, 20, 100, 50, 45, 25, 60, 80, 90, 35

.section .text
.global _start
_start:
    movl values, %ebx
    movl $1, %esi

loop:
    movl values(, %esi, 4), %eax
    cmpl %ebx, %eax
    cmova %eax, %ebx
    inc %esi
    cmpl $10, %esi
    jne loop

    pushl %ebx
    pushl $output
    call printf
    addl $8, %esp

    pushl $0
    call exit

